import random
import math

from State import State

States = [State("S1"), State("S2"), State("X1"), State("X2"), State("G")]

from Pattern import *

def isGoalState(state):
    if state == States[4]:
        return True
    return False

def isStartState(state):
    if state == States[0] or state == States[1]:
        return True
    return False

def communicate(talker, listener):
    (next, isRandom) = predict(listener.history, talker.patterns)
    listener.addToHistory(next)
